Slight modifications

Tried making the code cleaner.