setting things up

cleaned up and organized the given code