Updated source code to more readable format