Fixing small bug

Added more needed code chunks and fixed a typo in main file