misc stuff, not to be deleted, referenced on stackoverflow etc.