the comment is below, but i'll try to come up with better implementation