updated with my modifications