Changed certain operations to return for better implementation.