here are some changes to make this better