cleaned up the code a bit

cleaned up the code a bit