Added passing Piston functionality and cleaned code