attempts at optimization of existing code