New subroutines added, fixes needed, wroking on it