Removed some unnecessary commands and changed order