removed a lot of extra code