Merged omar and gabriels code