major rework, added stuff