All errors fixed with sample code