fixed a lot of BUGS!!!!