Added timer
Minor bugfixes