Sebastian's solution