reimplemeted form with tests