based on the work of @jennschiffer https://medium.com/cool-code-pal/3f10a496b515