added several features; improved performence 10x