still has bugs in the initialization