Added tiemr class (crashes though), moved timer code