more solutions and optimizations