silly me, declaring functions within functions when i dont need to