Added part of functionality from old version