Fixed bug

could refactor but just a class project