Cleaned up the code
Fixed and cleaned up the code