Development of algorithms for building energy efficiency