added templates
more pep8 and removed has_key refference
clear results from previous search