rewritten to be understandable