adding return value
implementing and fixing arrays