cleaned the code to look neat and short