Implemented proper ms timer