Refactored code

Fucked up errors in Git required manual intervention.