back and next button refactoring
added compile shape