only partial solutions, still need some tweaking to be perfect