resolves a lot of logic issues