simplified logic
updated gems