fixed code a lot