Removed some debug and unneeded code