Fixed indendations and removed unused code