bug fixes and instructions order changed