fixed bug
just about done