added test + fixed some things