still issues with sleeping, but things are looking better
fixed merge conflicts