Updated geometry functions and array operations