cleaned up the end