changed code to remove gradiant