Updated with tests