updated with ideas from @4ndr01d3