added return statement for proper chaining, some minor changes