Updated Code, got rid of redundant-ness