added error casting utility, improved the README