Fixed ++ function
Added timing to the main function