Removed unused code.
Added smooth sliding, as well as cleaned up code.