added function to test available memory