This is a lot of code...is this really necessary?