implement first and broken sorting
make sorting work properly
update forms to not use mode
update db creation