Added return and result code