tried some optimizations