Added test and rebased