updated code (initial commit)