Removed debudg and clean up code