Added dependencies and generic ploting function