Bug Fixes, Removed unused code