simplified and added docs