Added test. Fully funciontal.