Added trim feature

Graph is now trimmed to logicalArray.