cleaned code, fixed couple bugs ;)