bugs, some functionality, cleaning