Added ret op and completed self test