removes minute bug and added a test for it