Updated Functionality + Testing

Unit tests + some integration testing done.