A review and implementation of algorithms for fast and reliable fire detection