Cleaned code

Made the code more readable and concise