added small changes. doesnt work perfectly