Improved 5a, solved 5b