fix bugs! works!!!