attempt 1 at optimization