Added comments and removed test code