cleaned up my code a little