Added timing + minor bugfixes