solve 001a, 001b and 002a